import { ApiProperty } from '@nestjs/swagger';
import {
  IsNotEmpty,
  IsString,
} from 'class-validator';


export class FileInsertDto {

  @ApiProperty({ type: 'string', format: 'binary' })
  file: any;
}

export class FileDeleteDto {
  @IsString({ message: '图片地址需要是字符串' })
  @IsNotEmpty({ message: '图片地址不能为空' })
  @ApiProperty({ example: 'http://pic2.wineforyou.cn/admin20211029164233' })
  fileURL: string;
}

export class FileListDto {
  @ApiProperty({ example: '["http://pic2.wineforyou.cn/admin20211029182123"]' })
  urls?: Array<string>;

  /**
   *  一页显示几个
   */
  @ApiProperty({ example: 0 })
  pageSize: number;
  /**
   * 第几页
   */
  @ApiProperty({ example: 1 })
  current: number;
}
export class FileFindDto {
  @ApiProperty({ example: 'bg2' })
  @IsString({ message: 'original_name需要是字符串' })
  @IsNotEmpty({ message: 'original_name不能为空' })
  original_name: string;
}
